package com.liuhangs.learning.crowd.webui.bean.exception;

/**
 * 类描述: 主要时用于返回错误码和错误信息
 * @author licanfeng
 * @description 返回码和msg
 * @date 2019/3/12
 * @return
 */
public enum ErrorCode {
    OK(200, "OK"),
    HTTP_ERROR_100(100, "1XX错误"),
    HTTP_ERROR_300(300, "3XX错误"),
    HTTP_ERROR_400(400, "4XX错误"),
    HTTP_ERROR_500(500, "5XX错误"),
    SIGN_ERROR(120, "签名错误"),
    TIME_OUT(130, "访问超时"),
    KICK_OUT(300, "您已经在其他地方登录，请重新登录！"),
    BAD_REQUEST(407, "参数解析失败"),
    INVALID_TOKEN(401, "无效的授权码"),
    INVALID_CLIENTID(402, "无效的密钥"),
    REQUEST_NOT_FOUND(404, "访问地址不存在！"),
    METHOD_NOT_ALLOWED(405, "不支持当前请求方法"),
    REPEAT_REQUEST_NOT_ALLOWED(406, "请求重复提交"),
    SYSTEM_ERR(500, "服务器运行异常"),
    ERROR_USER(1000, "用户异常"),
    NOT_EXIST_USER(1001, "用户名不存在"),
    ERROR_PWD(1002, "输入的密码错误，请重新输入"),
    ACCOUNT_LOCK(1003, "账户被锁定，请联系管理员!"),
    TOKEN_INVALID(1004, "证书过期，请联系管理员!"),
    ACCOUNT_EXPIRED(1005, "账户过期，请联系管理员!"),
    ACCOUNT_STOP(1006, "账户被禁用，请联系管理员!"),
    LOGIN_ERROR(1099, "登录失败!"),

    REDIS_CONNECT_ERROR(10007, "redis连接异常"),
    BIND_PHONE(10010, "请绑定手机号"),
    UPLOAD_ERROR(20000, "上传文件异常"),
    INVALID_CAPTCHA(30005, "无效的验证码"),
    USER_FROZEN(40000, "该用户已被冻结");

    private int code;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}